//
//  Common.h
//  mibaotu
//
//  Created by admin on 16/9/14.
//  Copyright © 2016年 pegnk. All rights reserved.
//

#ifndef Common_h
#define Common_h


#endif /* Common_h */

typedef enum {
    MBStorySceneCellType_FenLei = 0,   //分类
    MBStorySceneCellType_FenLing,      //分龄
    MBStorySceneCellType_ChangJing,    //场景
    MBStorySceneCellType_AlbumList,    //热门专辑
    MBStorySceneCellType_HotAnchor,    //人气主播
}MBStorySceneCellType;

typedef enum  {//音频种类只有4个，分别是1、2、3、4
    MusicPLayType_Collection = 0,     //收藏
    MusicPLayType_ErGe,               //儿歌
    MusicPLayType_GuoXue,             //国学
    MusicPLayType_GuShi,              //故事
    MusicPLayType_English,            //英文
    MusicPLayType_QinZiXiu,            //亲子秀
    MusicPLayType_0_2,                  //0-2岁
    MusicPLayType_3_4,                  //3-4岁
    MusicPLayType_5_6,                  //5-6岁
    MusicPLayType_6_,                  //6-岁
    MusicPLayType_ShuiQianAnFu,        //睡前安抚
    MusicPLayType_FuMuXueTang,        //父母学堂
    MusicPLayType_XiXingYangCheng,    //习性养成
    MusicPLayType_ZhiLiKaiFa,         //智力开发
    MusicPLayType_ZuiXinShouFa,       //最新首发
    MusicPLayType_ChengZhangBiBei,     //成长必备
    MusicPLayType_DaJiaDouZaiTing,     //大家都在听
    MusicPLayType_RecentMusicPlay,     //最近播放
    MusicPLayType_DownedMusic,          //已下载
    MusicPLayType_DowningMusic,         //正在下载
    MusicPLayType_SearchMusic,         //搜索结果
    MusicPLayType_AlbumList,            //专辑列表
    MusicPLayType_Online,               //在线电台
}MusicPLayType;

typedef enum  {
    PLayerModelType_Shunxu = 0,         //顺序
    PLayerModelType_SuiJi,              //随机
    PLayerModelType_DanQu,              //单曲
}PLayerModelType;

typedef enum  {
    AudioPLayerType_Defult = 0,         //启动
    AudioPLayerType_YinPin ,         //音频
    AudioPLayerType_Qinzix,              //亲子秀
    AudioPLayerType_ZhuBo,              //主播
    AudioPLayerType_Online,              //电台
}AudioPLayerType;

typedef enum {
    MBSpaceMyCollectionShowType_Collection = 0,      //从收藏跳转而入，原生的
    MBSpaceMyCollectionShowType_Search,              //从搜索界面跳转过来
    MBSpaceMyCollectionShowType_Record,              //从录制界面跳转过来
}MBSpaceMyCollectionShowType;

typedef enum {
    MyCollectionShowType_Music = 0,         //歌曲
    MyCollectionShowType_Album,             //专辑
    MyCollectionShowType_ParentChildShow,   //亲子秀
    MyCollectionShowType_Anchor,            //主播
}MyCollectionShowType;

typedef enum {
    MBSpaceAddMusicType_Collection = 0, //从收藏跳入
    MBSpaceAddMusicType_SetAlbum,      //从新建分类
}MBSpaceAddMusicType;

typedef enum {
    ThirdLoginType_QQ = 0,  //QQ
    ThirdLoginType_WX,      //微信
    ThirdLoginType_WB,      //微博
}ThirdLoginType;

typedef enum {
    DowningMusicStepType_defult = 0,  //默认
    DowningMusicStepType_ALLStart,      //全部开始
    DowningMusicStepType_ALLStop,      //全部暂停
}DowningMusicStepType;

#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height


#define PERCEN  (ISIPAD ? .5: (ISPortrait?SCREEN_WIDTH/750.0:SCREEN_HEIGHT/750.0))
#define WIDTH_5S (SCREEN_WIDTH == 320||SCREEN_HEIGHT == 320)
#define ISIPAD ([[[UIDevice currentDevice]model] isEqualToString:@"iPad"])
#define PERCEN_HEIGHT  (SCREEN_HEIGHT/1334.0)
#define ISPortrait (SCREEN_WIDTH < SCREEN_HEIGHT) //竖屏

#define NAV_HEIGHT (IOS7 ? 64 : 44)
#define IOS7    ([[UIDevice currentDevice].systemVersion floatValue] >= 7.0)
#define IOS(a)   ([[UIDevice currentDevice].systemVersion floatValue] >= a)
#define IS_TEXT  (@"mobaotu")

#define UIColorFromHex(s)  [UIColor colorWithRed:(((s & 0xFF0000) >> 16))/255.0 green:(((s &0xFF00) >>8))/255.0 blue:((s &0xFF))/255.0 alpha:1.0]
// 获得RGB颜色
#define RGBColor(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define RGBCOLOR(r, g, b) [UIColor colorWithRed:(r)/255.0 green:(g)/255.0 blue:(b)/255.0 alpha:1.0]
#define CaseDoctorNameTextColor RGBColor(51,51,51)//     所有底色颜色均为：#efeff4      RGB:239 239 244
#define CZKeyWindow [UIApplication sharedApplication].keyWindow

//#define TINK_COLOR UIColorFromHex(0xeb6fa7)
#define TINK_COLOR (TINK_BG_COLOR)
#define TINK_BG_COLOR UIColorFromHex(0x4bd1d1)
#define TRACK_COLOR UIColorFromHex(0xcccccc)

#define PARENT_CHILD_SHOW_PATH  ([[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES)lastObject]stringByAppendingPathComponent:@"parentChildShow"])

#define FIRST_GUIDE_SHOW ([[NSUserDefaults standardUserDefaults]objectForKey:@"FIRST_GUIDE_SHOW"])
#define MUSIC_PRIVATE_NAME  (@"AAA")

//音频
// 缓存主目录
#define MusicCachesDirectory [[NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES) firstObject]stringByAppendingPathComponent:@"MusicCache"]
// 保存文件名
#define MusicFileName(url)  [[url componentsSeparatedByString:@"/"] lastObject]
// 文件的存放路径（caches）
#define MusicFilelpath(url) [MusicCachesDirectory stringByAppendingPathComponent:MusicFileName(url)]
// 文件的已下载长度
#define DownloadLength(filePath) [[[NSFileManager defaultManager] attributesOfItemAtPath:filePath error:nil][NSFileSize] integerValue]
// 存储文件信息的路径（caches）
#define DownloadDetailPath [MusicCachesDirectory stringByAppendingPathComponent:@"downloadDetail.data"]
